﻿using RestSharp;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Ymatou.ServiceCenter;

namespace YmtAuth.Dto
{
    /// <summary>
    /// IP区域认证
    /// </summary>
    [Resource("auth.ymatou.com", "/json/reply/IpAreaAuthStatusRequestDto", Method.POST, ParameterBuildType.FormUrlEncoded)]
    public class IpAreaAuthStatusRequestDto
    {
        /// <summary>
        /// 登录ID
        /// </summary>
        public string LoginId { get; set; }

        /// <summary>
        /// 登录密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// IP区域
        /// </summary>
        public string Ip { get; set; }

        /// <summary>
        /// 客户端是否已经验证了用户短信
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 客户端是否已经验证了用户安全问题
        /// </summary>
        public bool? VerifySecurityQuestion { get; set; }

        /// <summary>
        /// 数据来源
        /// </summary>
        public string Source { get; set; }

        /// <summary>
        /// Token超时时间
        /// </summary>
        public long? TokenTimeOut { get; set; }

        /// <summary>
        /// 请求ID
        /// </summary>
        public string RequestId { get; set; }

        /// <summary>
        /// Token来源
        /// </summary>
        public string TokenSource { get; set; }

        public override string ToString()
        {
            StringBuilder sb = new StringBuilder(" IpAreaAuthStatusRequestDto Parameters： ");
            sb.AppendFormat("LoginId: {0}, ", LoginId);
            sb.AppendFormat("Ip: {0}, ", Ip);
            sb.AppendFormat("Success: {0}, ", Success);
            sb.AppendFormat("VerifySecurityQuestion: {0}, ", VerifySecurityQuestion);
            sb.AppendFormat("Source: {0}, ", Source);
            sb.AppendFormat("TokenSource: {0}, ", TokenSource);
            sb.AppendFormat("RequestId: {0}, ", RequestId);
            sb.AppendFormat("TokenTimeOut: {0}", TokenTimeOut);

            string str = sb.ToString();
            return str.Length > 1000 ? str.Substring(0, 1000) : str;
        }
    }
}
